<?php
include '../../auth/ceklogin.php';
include '../../sql/conn.php';

$id = $_REQUEST['id'];
?>

<style type="text/css">
    .dv-table{
        width:80%;
    }
    .dv-table td{
        border:1px solid #D0E5F5;
        padding:5px
    }
    .dv-label{
        font-weight:bold;
        color:#15428B;
        width:100px;
    }
</style>

<table class="dv-table">
    <thead>
        <tr style="background-color:#D0E5F5;text-align:center">
            <th style="width:50%;">Item</th>
            <th style="width:15%;">Qty</th>
            <th style="width:10%;">Currency</th>
            <th style="width:25%">Price</th>
        </tr>
    </thead>
    <tbody>
        <?php
        $query = mysql_query("
            select c.namaBarang, b.qtyBarang, b.namaCurrency, format(b.priceItem,0) as priceItem
            from quotation a,quotation_item b, barang c
            where c.idBarang=b.idBarang and b.idQuotation=a.idQuotation and a.idQuotation='$id'
        ");
        while ($row = mysql_fetch_array($query)) {
            ?>
            <tr>
                <td style="width:50%;"><?php echo $row[0]; ?></td>
                <td style="width:15%;" align="right"><?php echo $row[1]; ?></td>
                <td style="width:10%;" align="center">    
                    <?php
                    if ($row[2] == "IDR") {
                        echo "RP";
                    } else {
                        echo "$";
                    }
                    ?></td>
                <td style="width:20%;" align="right"><?php echo $row[3]; ?></td>
            </tr>
            <?php
        }
        ?>
    </tbody>
</table>
<?php
echo mysql_error();
mysql_close();
?>

